package com.banyuan.lesson.输入输出流;

import java.io.FileWriter;
import java.io.IOException;

/*
 * 文件字符输出流*/
public class TestFileWriter {
    public static void main(String[] args) {
        try (FileWriter fw = new FileWriter("bbb.text", true)) {
            //单个字符输入
            fw.write('h');
            //字符数组输入
            char[] arr = "sdeafweqw".toCharArray();
            fw.write(arr, 0, arr.length - 1);
            //字符串输入
            String s = "sdfasdas2fas";
            fw.write(s, 0, s.length() - 1);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
